﻿using Lsk.Business.DTO;
using Lsk.Data;
using System;
using System.Collections.Generic;
using System.Data.Entity.Core.Objects;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lsk.Business
{
    public class PropertyNew
    {
        private lskEntities _entity;

        public PropertyNew()
        {
            _entity = new lskEntities();
        }


        public IEnumerable<GetNewLaunch_Result> GetPropertyNew()
        {
            ObjectResult<GetNewLaunch_Result> news = _entity.GetNewLaunch();
            return news.AsEnumerable<GetNewLaunch_Result>();
        }

        public PropertyNewMessage GetPropertyNew(string guid)
        {
            PropertyNewMessage response = new PropertyNewMessage();
            Mobile_NewLaunch data = (from a in _entity.Mobile_NewLaunch where a.ProjectId == new Guid(guid) select a).FirstOrDefault();
            response.PropertyNew = data;
            response.pictureList = _entity.GetPictureByID(guid);
            return response;

        }
    }
}
